{notempty name="activity"}
<style>
.am-modal-mask {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    z-index: 999;
    background-color: rgba(0,0,0,.4);
}
.am-modal-wrap {
    position: fixed;
    overflow: auto;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    height: 100%;
    z-index: 999;
    -webkit-overflow-scrolling: touch;
    outline: 0;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transform: translateZ(.01rem);
    transform: translateZ(.01rem);
}
.am-modal {
    position: relative;
}
.am-modal-transparent {
    /*width: 5.4rem;*/
}
.am-modal-content {
    position: relative;
    background-color: #fff;
    border: 0;
    background-clip: padding-box;
    text-align: center;
    height: 100%;
    overflow: hidden;
}
.am-modal-transparent .am-modal-content {
    border-radius: .14rem;
    padding-top: .3rem;
}
.am-modal-body {
    font-size: .3rem;
    color: #888;
    height: 100%;
    line-height: 1.5;
    overflow: auto;
}
.am-modal-transparent .am-modal-content .am-modal-body {
    padding: 0 .3rem .3rem;
}
.modal--3pq4D {
    width: 100%;
    height: 100%;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2;
    display: -webkit-box;
    display: -webkit-flex;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -webkit-align-items: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -webkit-justify-content: center;
    -ms-flex-pack: center;
    justify-content: center;
}
.am-modal-mask {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    height: 100%;
    z-index: 999;
    background-color: rgba(0,0,0,.4);
}
.modal-box--j8DYk {
    /*width: 5.4rem;
    height: 7.68rem;*/
	width: 217px;
    height: 306px;
    position: absolute;
    z-index: 1000;
    left: 50%;
    top: 50%;
    -webkit-transform: translate(-50%,-50%);
    -ms-transform: translate(-50%,-50%);
    transform: translate(-50%,-50%);
}
.bg--3jn_I {
    width: 100%;
    height: 100%;
    background-position: 50%;
    z-index: 2;
}
.bg--3jn_I, .lolly--1aArG {
    background-repeat: no-repeat;
    background-size: contain;
    position: absolute;
}
.content--1u1P_ {
    min-height: 2.1rem;
    padding-top: 100px;
    position: absolute;
    z-index: 2;
    width: 100%;
}
.content--1u1P_ p {
    margin: 0;
}
.content--1u1P_ .text-1--19kZE {
    font-size: 14px;
    font-weight: 700;
    color: #c83502;
}
.content--1u1P_ .text-2--15PBN {
    font-size: 28px;
    font-weight: 800;
    color: #f60705;
    width: 80%;
    margin: auto;
}
.button--3sEc0 {
    /*width: 4.26rem;
    height: 1.31rem;*/
	width:176px;
	height:54px;
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: .24rem;
    background-repeat: no-repeat;
    background-position: 50%;
    background-size: contain;
    -webkit-transform: translateX(-50%);
    -ms-transform: translateX(-50%);
    transform: translateX(-50%);
    background-image: url("/uploads/activity/paybtn.png");
}

.bg--3jn_I, .lolly--1aArG {
    background-repeat: no-repeat;
    background-size: contain;
    position: absolute;
}
.lolly--1aArG {
	/*
    top: -.8rem;
    right: .1rem;
    width: .53rem;
    height: 1.8rem;*/
	top:-40px;
	right: 0px;
	width:22px;
	height:74px;
    background-image: url("/uploads/activity/23b825f68a.png");
}
</style>
<div id="am-modal-container" data-activityid="{$activity.id}">
  <div>
    <div class="am-modal-mask"></div>
    <div class="am-modal-wrap " role="dialog">
      <div role="document" class="am-modal am-modal-transparent">
        <div class="am-modal-content">
          <div class="am-modal-body">
            <div class="modal--3pq4D">
              <div class="am-modal-mask"></div>
              <div class="modal-box--j8DYk">
                <div class="bg--3jn_I" style="background-image: url(&quot;/uploads/activity/template_popup_bg{$activity.template_id}.png?v=2&quot;);"></div>
					<div class="content--1u1P_">
					  <p class="text-1--19kZE" style="{if $activity['template_id']==2}color: #fff;{else}color: rgb(200, 53, 2);{/if}">[共得{$activity.egold}阅读币+{$activity.giveegold}书币]</p>
					  <p class="text-2--15PBN" style="{if $activity['template_id']==2}color: #fff;{else}color: rgb(200, 53, 2);{/if}">充{$activity.price}元</p>
					</div>
					<div class="button--3sEc0" style="background-image: url(&quot;/uploads/activity/paybtn.png?v=2&quot;);" id="btn_recharge_popup" data-money='{$activity.price}'></div>
                <div class="lolly--1aArG"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
<script type="text/javascript" src="/public/js/json2.js"></script>

<script type="text/javascript">
<!--
	var jumpurl = window.location.href;
	var loginurl = "/login?backurl="+jumpurl;
	var login = {if session('user_auth.uid')>0}{$Think.session.user_auth.uid}{else}0{/if};
	var payurl = "{:config('agent_payurl')}";
	var pay_change = {:config('pay_change')};
	$(function(){
		var activityid = $('#am-modal-container').data('activityid');
		
		
		$(".lolly--1aArG").on("click",function(){
			$("#am-modal-container").hide();
		})
		var ua = navigator.userAgent.toLowerCase();
		/*
		if (ua.match(/MicroMessenger/i)!="micromessenger" || localStorage.getItem('activity_'+activityid))
		{
			$('#am-modal-container').hide();
		}else{
			localStorage.setItem('activity_'+activityid,activityid);
		}*/

		if (localStorage.getItem('activity_'+activityid))
		{
			$('#am-modal-container').hide();
		}else{
			localStorage.setItem('activity_'+activityid,activityid);
		}
		
		$('#btn_recharge_popup').click(function(){
			var money = $(this).data('money');

			var ua = navigator.userAgent.toLowerCase();
			if(ua.match(/MicroMessenger/i)=="micromessenger") {  
				if (pay_change==1)
				{
					var url = payurl+'/pay/pay.html?egold='+money+'&type=4&activityid='+activityid+'&isactivity=1&jumpurl='+jumpurl;
				}else{
					var url = payurl+'/pay/thirdpay.html?egold='+money+'&type=4&activityid='+activityid+'&isactivity=1&jumpurl='+jumpurl;
				}
			} else {  
				var url = payurl+'/alipay/pay.html?egold='+money+'&type=4&activityid='+activityid+'&isactivity=1&jumpurl='+jumpurl;
			} 

			if(login)
			{
				document.location.href=url
			}else{
				document.location.href=loginurl	
			}
		})
	})
//-->
</script>
{/notempty}